<template>
    <div>
        <el-dialog
            title="提示"
            :visible.sync="checkHoldCardDialog"
            @close="handleClose"
            width="30%"
            center>
            <span>需要注意的是内容是默认不居中的</span>
            <span slot="footer" class="dialog-footer">
                <el-button @click="sendCenterDialogVisible(false)">取 消</el-button>
                <el-button type="primary" @click="sendCenterDialogVisible(false)">确 定</el-button>
                <!-- <el-button @click="sendDialogStatus($event)">取 消</el-button>
                <el-button type="primary" @click="sendDialogStatus($event)">确 定</el-button> -->
            </span>
        </el-dialog>
    </div>
   
</template>

<script>
export default {
    name: "CustomDialog",
    props:["checkHoldCardDialog","getCenterDialogVisible"],
    data(){
        return {
            //checkHoldCardDialog: this.checkHoldCardDialog
            // 可以在这里定义一些数据
            //dialogTableVisible: false
        }
      
    },
    created(){
        console.log("组件被creared时checkHoldCardDialog的值为:",this.checkHoldCardDialog);
    },
    // computed:{
    //     holdCardDialog:{
            
    //     }    
    // },
    methods:{
        sendCenterDialogVisible(val){
            console.log("发送 centerDialogVisible 状态到父组件", val);
            //console.log("当前 this 为", this);
            //this.centerDialogVisibleState = val;
            //console.log("当前 centerDialogVisible 状态", this.checkHoldCardDialog);
            //通知父组件centerDialogVisible状态
            this.checkHoldCardDialog = false;
            this.getCenterDialogVisible(val)
        },
        handleClose(){
            console.log("dialog框关闭时的回调")
            console.log("获取到dialog框的状态值为:")
            this.checkHoldCardDialog = false;
            this.getCenterDialogVisible(false)
        },
    }
}
</script>

<style>

</style>